package comment;

public class AppResult <T>{

   private int  code;
    private String message;

    public static AppResult success(String message){
        AppResult appResult = new AppResult();
        appResult.setCode(0);
        appResult.setMessage(message);
        return appResult;
    }

    public static AppResult success(){
        AppResult appResult = new AppResult();
        appResult.setCode(0);
        appResult.setMessage("成功");
        return appResult;
    }


    public static AppResult failed(String message){
        AppResult appResult = new AppResult();
        appResult.setCode(1000);
        appResult.setMessage(message);
        return appResult;
    }

    public static AppResult failed(){
        AppResult appResult = new AppResult();
        appResult.setCode(1000);
        appResult.setMessage("失败");
        return appResult;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
